package stringTest;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PatternTestTest {

	
	public void testTest() {
		//fail("Not yet implemented");

		String tempStr = "java regular exp";
//		System.out.println(tempStr.indexOf("cc", 1));
//		System.out.println(tempStr.replaceAll(regex, replacement));
		
//		System.out.println(tempStr.trim());
		 Pattern ptn = Pattern.compile("\\s{7}");
//		Pattern ptn = Pattern.compile("^(?:\\w+\\.?)*\\w+@(?:\\w+\\.)+\\w+$");
		// ("^(?:\\w+\\.?)*\\w+@(?:\\w+\\.)+\\w+$");

		 
		 
		Matcher matcher  = ptn.matcher(tempStr);
		boolean b = matcher.find();
//		boolean b = matcher.matches();
		
		  // �� �� �̻��� ���ӵ� ��,���� ��鹮�ڸ� �ǹ��ϴ� ����; �����.
//        Pattern p = Pattern.compile("[,{space}]+");
//		Pattern p = Pattern.compile("[1-13]");
        // ���Ͽ� ��� �Է� ���ڿ�; �ɰ���.
//        String[] result = p.split("one,two, three   four ,  five");

//        for (int i=0; i<result.length; i++)
//
//            System.out.println(result[i]);


		
        if (b) {
            System.out.println("match");
            System.out.println(matcher.group());
        } else {
            System.out.println("not match");
          //  System.out.println(matcher.group());
        }

		
		//show matches
		/*while(matcher.find()) {
			System.out.printf("Found: \"%s\"  from %d to %d.%n",
					matcher.group(),matcher.start(),matcher.end());
		}*/
	}

}
